{include file="common/header.tpl"}
{if $AppUI->id <= 0}
	{include file="index/login.tpl"}  
{else}
	{include file="common/menu.tpl"}
    <div class="rightColumn">
    	<div class="boxContent">
        	<div class="contentItem">
                <div class="contentItems">
                	{if $intStatuses >= 0}
                		<div class="headerTitle">
                        	<h2>
                            	{if $row.statuses == 0}
                            		<a href="{if $strRefer != ""}{$strRefer}{else}{$smarty.const.HOST_BACKEND}news/waiting{/if}">Điểm tin mới</a>
                                {elseif $row.statuses == 1}
                                	<a href="{if $strRefer != ""}{$strRefer}{else}{$smarty.const.HOST_BACKEND}news/index{/if}">Tin đã duyệt</a>
                                {elseif $row.statuses == 2}
                                	<a href="{if $strRefer != ""}{$strRefer}{else}{$smarty.const.HOST_BACKEND}news/unaccept{/if}">Tin không duyệt</a>
                                {elseif $row.statuses|abs == 3}
                                	<a href="{if $strRefer != ""}{$strRefer}{else}{$smarty.const.HOST_BACKEND}news/delete{/if}">Tin bị xóa</a>
                               	{elseif $row.statuses == 4}
                                	<a href="{if $strRefer != ""}{$strRefer}{else}{$smarty.const.HOST_BACKEND}news/report{/if}">Tin bị báo vi phạm</a>
                                {/if}
                                &raquo; Chi tiết
                           	</h2>
                       	</div>
                    {/if} 
                    <div class="secData">
                    	<table width="100%" cellpadding="0" cellspacing="0" border="0">
                        	<thead>
                            	<tr>
                                	<th width="20%">Trường dữ liệu</th>
                                    <th>Thông tin</th>
                                </tr>
                            </thead>
                            <tbody>
                            	<tr class="odd">
                                	<td>Mã:</td>
                                    <td><strong>{$row.newid}</strong></td>
                                </tr>
                                <tr class="even">
                                	<td>Tiêu đề:</td>
                                    <td><strong>{$row.title}</strong></td>
                                </tr>
                            	<tr class="odd">
                                	<td>Đăng bởi:</td>
                                    <td><strong>{$row.userid|ouser}</strong></td>
                                </tr>
                                <tr class="even">
                                	<td>Nội dung:</td>
                                    <td class="content">
                                    	{$row.content}
                                    </td>
                                </tr>
                                <tr class="odd">
                                	<td>Hình minh họa:</td>
                                    <td>{image path=$row.image type=5}</td>
                                </tr>
                                <tr class="even">
                                	<td>Yêu thích</td>
                                    <td><strong>{$row.tlike|number_format:"0":",":"."}</strong></td>
                                </tr>
                                <tr class="odd">
                                	<td>Lượt xem</td>
                                    <td><strong>{$row.tread|number_format:"0":",":"."}</strong></td>
                                </tr>
                                <tr class="even">
                                	<td>Bình luận:</td>
                                    <td><strong>{$row.tcmt|number_format:"0":",":"."}</strong></td>                                	
                                </tr>
                                <tr class="odd">
                                	<td>Bình luận cuối</td>
                                    <td><strong>{$row.lastcmt|date_format:"%d/%m/%Y %H:%M:%S"}</strong></td>
                                </tr>
                                <tr class="even">
                                	<td>Báo vi phạm:</td>
                                    <td><strong>{$row.treport}</strong></td>
                                </tr>
                                <tr class="odd">
                                	<td>Link nguồn:</td>
                                    <td>{if $row.resource}<a href="{$row.resource}" target="_blank"><strong>{$row.resource}</strong></a>{else}----//----{/if}</td>
                                </tr>
                                <tr class="even">
                                	<td>Tags:</td>
                                    <td>{if $row.tags}<strong>{$row.tags}</strong>{else}----//----{/if}</td>
                                </tr>
                                <tr class="odd">
                                	<td>Ngày đăng:</td>
                                    <td><strong>{$row.postdate|date_format:"%d/%m/%Y %H:%M:%S"}</strong></td>
                                </tr>
                                <tr class="even">
                                	<td>Tình trạng:</td>
                                    <td>
                                    	{if $row.statuses == 0}
                                        	<strong>Chờ duyệt</strong>
                                       	{elseif $row.statuses|abs == 1}
                                        	{if $row.statuses == 1}
	                                        	<strong>BQT duyệt</strong>
                                           	{else}
                                            	<strong>User đã chỉnh nội dung sau khi duyệt</strong>
                                            {/if}
                                       	{elseif $row.statuses == 2}
                                        	<strong>BQT không duyệt</strong>
                                       	{elseif $row.statuses == 3}
                                        	<strong>BQT xóa</strong>
                                       	{elseif $row.statuses == 4}
                                        	<strong>Báo vi phạm</strong>
                                       	{/if}
                                   	</td>
                                </tr>
                                <tr class="odd">
                                	<td>&nbsp;</td>
                                    <td>
                                    	{if ($smarty.session.blog&1<<5) > 0}
                                            {if $row.treport == 0}
                                                {if $row.statuses == 0}
                                                    <a href="{$smarty.const.HOST_BACKEND}news/act?paction=1&amp;newid={$row.newid}&amp;refer={$refer|base64E}&amp;de=1&amp;uid={$row.userid}" class="btn">Duyệt</a>
                                                {elseif $row.statuses == 2 || ($row.statuses == 3 && $AppUI->type > 1)}
                                                    <a href="{$smarty.const.HOST_BACKEND}news/act?paction=1&amp;newid={$row.newid}&amp;refer={$refer|base64E}&amp;de=1&amp;uid={$row.userid}" class="btn">Phục hồi</a>
                                                {/if}
                                            {else}
                                                <a href="{$smarty.const.HOST_BACKEND}news/act?paction=5&amp;newid={$row.newid}&amp;refer={$refer|base64E}&amp;de=1&amp;uid={$row.userid}" class="btnLarge">Gỡ bỏ vi phạm</a>
                                            {/if}
                                        {/if}    
                                        {if ($smarty.session.news&1<<4) > 0 && $row.treport == 0 && $row.statuses < 2}
                                        	<a href="{$smarty.const.HOST_BACKEND}news/act?paction=3&amp;newid={$row.newid}&amp;refer={$refer|base64E}&amp;de=1&amp;uid={$row.userid}" class="btn">Không duyệt</a>
                                        {/if}  
                                        {if ($smarty.session.news&1<<3) > 0} 
                                            <a href="{$smarty.const.HOST_BACKEND}news/act?paction=2&amp;newid={$row.newid}&amp;refer={$refer|base64E}&amp;de=1&amp;uid={$row.userid}" class="btn">Xóa</a> 
                                            {if $AppUI->type > 1}
                                                <a href="{$smarty.const.HOST_BACKEND}news/act?paction=4&amp;newid={$row.newid}&amp;refer={$refer|base64E}&amp;de=1&amp;uid={$row.userid}" class="btnLarge">Xóa khỏi database</a> 
                                            {/if}
                                        {/if}                         	
                                        {*if ($smarty.session.news&1<<2)>0}
                                        	<a href="{$smarty.const.HOST_BACKEND}news/edit?newid={$row.newid}" class="btn">Chỉnh sửa</a>
                                        {/if*}
                                 	</td>
                                </tr>                                
                            </tbody>
                        </table>
                    </div>
                </div>
          	</div>
        </div>
    </div>
{/if}
{include file="common/footer.tpl"}
                
